package cn.edu.ncu.housinghub.config;

import lombok.Getter;

import java.security.Principal;

/**
 * WebSocket用户主体类
 */
@Getter
public class WebSocketUserPrincipal implements Principal {

    private final String userId;
    private final String username;

    public WebSocketUserPrincipal(String userId, String username) {
        this.userId = userId;
        this.username = username;
    }

    @Override
    public String getName() {
        return userId; // 返回用户ID作为主体名称
    }

}
